home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Lib / test / test_support.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-06-23  |  2.2 KB  |  57 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. TestFailed = 'test_support -- test failed'
  5. verbose = 1
  6.  
  7. def unload(name):
  8.     import sys
  9.     
  10.     try:
  11.         del sys.modules[name]
  12.     except KeyError:
  13.         pass
  14.  
  15.  
  16.  
  17. def forget(modname):
  18.     unload(modname)
  19.     import sys
  20.     import os
  21.     for dirname in sys.path:
  22.         
  23.         try:
  24.             os.unlink(os.path.join(dirname, modname + '.pyc'))
  25.         except os.error:
  26.             0
  27.             0
  28.             sys.path
  29.         except:
  30.             0
  31.  
  32.     
  33.  
  34. FUZZ = 1e-06
  35.  
  36. def fcmp(x, y):
  37.     if type(x) == type(0.0) or type(y) == type(0.0):
  38.         
  39.         try:
  40.             (x, y) = coerce(x, y)
  41.             fuzz = (abs(x) + abs(y)) * FUZZ
  42.             if abs(x - y) <= fuzz:
  43.                 return 0
  44.         except:
  45.             pass
  46.  
  47.     elif type(x) == type(y) and type(x) in (type(()), type([])):
  48.         for i in range(min(len(x), len(y))):
  49.             outcome = fcmp(x[i], y[i])
  50.         
  51.         return cmp(len(x), len(y))
  52.     
  53.     return cmp(x, y)
  54.  
  55. TESTFN = '@test'
  56. unlink
  57.